package com.flower.queue.controller;

import com.flower.queue.producer.AlarmProducer;
import org.apache.activemq.command.ActiveMQQueue;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.jms.Destination;


@RestController
@EnableScheduling
public class QueueController {

    @Autowired
    AlarmProducer alarmProducer;

    @RequestMapping("send")
    @Scheduled(fixedDelay = 2000)
    public void send(){
        alarmProducer.sendMessage("111");
    }
}
